﻿Public Class 猜数字
    '    Random ra = new Random();
    'int a = ra.Next(1, 10);
    'Console.WriteLine("五次机会 10以内的数字");

    'string strB = "";

    'for (int i = 0; i < 5; i++)
    '{
    '    strB = Console.ReadLine();
    '    int intB = Convert.ToInt32(strB);
    '    if (intB == a)
    '    {
    '        Console.WriteLine("哈哈 今天运气好 正确答案:" + a.ToString() + "");
    '        return;
    '    }
    '    else {
    '        Console.WriteLine("不正确");
    '    }

    '    //Console.Write("\n");
    '}

    'Console.WriteLine("今天运气不好");

    Public Function do1()
        Dim ra = New Random()
        Dim a = ra.Next(1, 10)
        Console.WriteLine("五次机会 10以内的数字")
        For i = 0 To 5
            Dim b = Console.ReadLine()
            If b = a Then
                Console.WriteLine("哈哈 今天运气好 正确答案:" + a.ToString() + "")
                Return vbEmpty
            Else
                Console.WriteLine("不正确")
            End If
        Next
        Console.WriteLine("今天运气不好")
    End Function

End Class
